<?php
require_once dirname(__FILE__)."/../../classes/Posts.class.php";
require_once dirname(__FILE__)."/../pagination/posts/pagination.php";

$res = $posts->show_posts($start, $num);
foreach($res as $value){
    $id = $value['id'];
    $title = $value['title'];
    $name = $value['name'];
    $cat = $value['cat_name'];
    $dt = $value['date_create'];
    $short = nl2br($value['short']);
    $content = $value['content'];
    $visits = $value['visits'];
    $login = $value['login'];
    echo <<<LABEL
    <table style = "width: 100%" valign="top">
      <tr>
        <td width = "100%" height = "150px" bgcolor="#F0F8FF" valign="top">
            <center><h2><a href="index.php?more=$id">$name</a></h2></center>    <br />
             <p align="left">
             $short
          </p>
          <div class="separator">
          </div>
          <div class="left">
            <div class="cat">
              $login |
              $cat   |
              $dt    |
              Посещений($visits)
            </div>   
          </div>  
          <div class="right">
            <a href="index.php?more=$id">Подробнее</a>
          </div>
          </td>
      </tr>
    </table>
LABEL;

} 
?>
